package com.rainng.coursesystem.manager.member;

import com.rainng.coursesystem.dao.MemberDAO;
import com.rainng.coursesystem.manager.BaseManager;
import com.rainng.coursesystem.model.entity.MemberEntity;
import com.rainng.coursesystem.model.vo.response.MemberInfoVO;
import org.springframework.stereotype.Component;

@Component
public class InfoManager extends BaseManager {
    private final MemberDAO memberDAO;

    public InfoManager(MemberDAO memberDAO) {
        this.memberDAO = memberDAO;
    }

    public MemberInfoVO getMemberInfoByMemberId(Integer memberId) {
        return memberDAO.getMemberInfoById(memberId);
    }

    public MemberEntity getMemberById(Integer memberId) {
        return memberDAO.get(memberId);
    }

    public int updateMember(MemberEntity entity) {
        return memberDAO.update(entity);
    }
}
